﻿using Ecommerce.API.Application.Command.RoleCommand;
using Ecommerce.Domain;
using Ecommerce.Services.User;
using MediatR;

namespace Ecommerce.API.Application.CommandHandlers.RoleHandler
{
    public class UserGetCommandHandler:IRequestHandler<UserGetCommand, object>
    {
        private readonly IUseInfoServices services;

        public UserGetCommandHandler(IUseInfoServices services)
        {
            this.services = services;
        }

        public Task<object> Handle(UserGetCommand request, CancellationToken cancellationToken)
        {
            return services.GetUser(request.Pid);
        }
    }
}
